/* 
 * File:   MPIBasics.cpp
 * Author: alexander
 * 
 * Created on July 28, 2011, 3:17 PM
 */

#include "MPIBasics.h"

MPIBasics::MPIBasics() {
}

MPIBasics::MPIBasics(const MPIBasics& orig) {
}

MPIBasics::~MPIBasics() {
}

void MPIBasics::sendSolution(double *x, int n, int dest, int tag){
    MPI_Send(x, n, MPI_DOUBLE, dest, tag, MPI_COMM_WORLD);
}

void MPIBasics::receiveSolution(double *x, int n, int source, int tag, MPI_Status *status){
    MPI_Recv(x,n,MPI_DOUBLE, source, tag, MPI_COMM_WORLD, status);
}

void MPIBasics::sendDouble(double *value, int n, int dest, int tag){
    MPI_Send(value, n, MPI_DOUBLE, dest, tag, MPI_COMM_WORLD);
}

void MPIBasics::receiveDouble(double *value, int n, int source, int tag, MPI_Status *status){
    MPI_Recv(value, n, MPI_DOUBLE, source, tag, MPI_COMM_WORLD, status);
}

void MPIBasics::sendInteger(int *value, int n, int dest, int tag){
    MPI_Send(value, n, MPI_INT, dest, tag, MPI_COMM_WORLD);
}

void MPIBasics::receiveInteger(int *value, int n, int source, int tag, MPI_Status *status){
    MPI_Recv(value, n, MPI_INT, source, tag, MPI_COMM_WORLD, status);
}

void MPIBasics::ping(){
    printf("MPIBasics.ping sucesso.\n");
}

